-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Move and delete models using interactive markers #28
[Feature] Move and delete models using interactive markers #28
Conversation
This looks cool. I've got to get to bed but I'll try it out first thing tomorrow. I'll have to look into the tween interaction. The tween plugin is fairly "dumb" about motion (it just teleports things around between start and end). It could be made relative to the current position which would probably cause it to interact nicely with this. I don't think it needs to be fixed to merge this in. We actually have a Spawn Model rviz tool plugin already. It has one minor issue (#15) but otherwise works fairly well. Hit the (+) button in Rviz and add it to your toolbar if you haven't tried it. |
It occurs to me that now that we can add, move and delete models from the world, we'll probably also want to implement a "save world" and/or "save world as" service call soon. I'll add that to the trello |
Ah yes, I checked out the model spawn tool earlier, haha. I agree; saving worlds for later would be great. |
I think if the tween plug in stores the old position at the end of its update loop, then gets its delta at the beginning of the update loop ("how much was I moved") then applied it to its start/end position it would handle being moved. It may just make a giant mess though. |
I had a chance to try this branch out. I like the feature, but I'm not sure if one handle for translate+rotate is the best solution. Two notes:
|
Fixed minor whitespace lint error
Looking at the interactive markers available, maybe marker similar to this one with rotate on Z axis and translate on X/Y axis? |
Be sure to test what happens when the screen is resized while all this
moving stuff around is happening.
…On Fri, Oct 13, 2017 at 1:27 AM, Joseph Duchesne ***@***.***> wrote:
I think if the tween plug in stores the old position at the end of its
update loop, then gets its delta at the beginning of the update loop ("how
much was I moved") then applied it to its start/end position it would
handle being moved. It may just make a giant mess though.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#28 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHBvS8AAIfGD1GZokS_kJ4IhNFkiEGucks5srvTSgaJpZM4P3-mP>
.
|
I made the changes to implement the two separate controls for you to try out. I agree that two separate controls for translation and rotation would provide more precise positioning. However, the benefit of having a single control is for when the robot is moving when you want to reposition it. If you want to change both its position and orientation, you'll have to catch the robot's rotation control after it starts moving when you release its position control, or vice versa. There are two ways I can think of to get the benefits of the two separate controls without the annoyance of having to grab the second control after the robot starts moving again:
I also realized that letting the simulation continue while the user is dragging an interactive marker could be undesirable in some situations. I made some minor modifications to this branch to skip the physics and plugin updates while the interactive marker server is between mouse down and mouse up events, and it seems to work nicely. However, since this is a little off topic for this PR, I'll make another one later once we've agreed on the interactive marker behavior itself, and you think it's a good idea that is worthy of discussion and integration. |
Thanks for the excellent PR. I agree that splitting the functionality makes it harder to interact with moving models. I think both proposed options are good but the pause/resume button would be more generally useful (I can think of several other use-cases for that). If we do add a play/pause feature it could be generalized to a service to handle the rviz/flatland_viz integration. That should allow for pausing, changing one or more models, then resuming. Also, thank you for keeping the scope of this PR focused. That's a good skill to have! On an entirely different note, you should sign up for https://hacktoberfest.digitalocean.com/ to potentially get a free T-shirt for open source contributions this month. I think you're at 2/4 or 3/4 pull requests depending on if the declined one counts, and half way through the month. If you happen to submit another 1-2 PRs to this or any other github repo you should be eligible. (If you're into free t-shirts that is!) I'll try to update the tween plugin to play more nicely with interactive markers. |
To try it out:
roslaunch flatland_server server.launch
The tween model 'walker1' ignores any attempts to move it, and I haven't dug into it to see why. Perhaps someone can look into that, or we can detect the type of plugin and not generate interactive markers for tweens.
Also, I couldn't think of a good way to spawn models using interactive markers. There could be a fixed marker that has a context menu to spawn a model, but setting the parameters normally specified in the world YAML file seems to be a challenge. Maybe a dynamic reconfigure GUI instead and use a bool parameter as a trigger button? This is definitely something to discuss.